import {FETCH_DASHBOARD, LOGIN, REGISTER} from "./const";

export const loginLoadingStartAction = () => (
  {
    type: LOGIN,
    payload: {
      login: true,
    }
  }
);

export const loginLoadingEndAction = () => (
  {
    type: LOGIN,
    payload: {
      login: false,
    }
  }
);

export const registerLoadingStartAction = () => (
  {
    type: REGISTER,
    payload: {
      register: true,
    }
  }
);

export const registerLoadingEndAction = () => (
  {
    type: REGISTER,
    payload: {
      register: false,
    }
  }
);

export const dashboardLoadingStartAction = () => (
  {
    type: FETCH_DASHBOARD,
    payload: {
      fetchDashboard: true,
    }
  }
);

export const dashboardLoadingEndAction = () => (
  {
    type: FETCH_DASHBOARD,
    payload: {
      fetchDashboard: false,
    }
  }
);

